<!DOCTYPE html>
<html lang="en" class="js csstransforms3d">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="generator" content="Hugo 0.54.0" />
    <meta name="description" content="">


    <link rel="icon" href="/favicon.png" type="image/png">


    
      <title>bettercap :: Usage</title>
    


    
    <link href="/css/nucleus.css?1559576463" rel="stylesheet">
    <link href="/css/fontawesome-all.min.css?1559576463" rel="stylesheet">
    <link href="/css/hybrid.css?1559576463" rel="stylesheet">
    <link href="/css/featherlight.min.css?1559576463" rel="stylesheet">
    <link href="/css/perfect-scrollbar.min.css?1559576463" rel="stylesheet">
    <link href="/css/auto-complete.css?1559576463" rel="stylesheet">
    <link href="/css/theme.css?1559576463" rel="stylesheet">
    <link href="/css/hugo-theme.css?1559576463" rel="stylesheet">
    
      <link href="/css/theme-green.css?1559576463" rel="stylesheet">
    

    <script src="/js/jquery-2.x.min.js?1559576463"></script>

    <style type="text/css">
      :root #header + #content > #left > #rlblock_left{
          display:none !important;
      }
      
    </style>
    <style type="text/css">
code {
  color: #444;
  background: #eee;
  border: 1px solid #ccc;
}

.copy-to-clipboard {
  background-color: #eee;
  border: 1px solid #ccc;
  border-left: none;
  height: 19px !important;
}

#support {
  font-size:5em; 
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -ms-flex-wrap: wrap;
  flex-wrap: wrap;
  max-width: 470px;
  margin: auto;
}

#support > .col {
  margin-right: 20px;
}

h1 {
  font-size: 2.5rem;
}

h1 code, 
h2 code, 
h3 code, 
h4 code, 
h5 code {
  width: 50%;
  font-size: 15px;
  color: #c5c8c6;
  background: #1d1f21;
  padding: 5px 20px 5px 5px;
}

h1 span.copy-to-clipboard, 
h2 span.copy-to-clipboard, 
h3 span.copy-to-clipboard, 
h4 span.copy-to-clipboard, 
h5 span.copy-to-clipboard {
  display: none;
}

a.highlight code {
  background: initial; 
  border: none;
}

a.highlight span.copy-to-clipboard {
  display: none;
}

</style>

  </head>
  <body class="" data-url="/usage/">
    <nav id="sidebar" class="">



  <div id="header-wrapper">
    <div id="header">
      <a id="logo" href="/">
  <h1 style="margin:0; padding:0">
    <img src="/logo.png" style="width: 150px" alt="bettercap"/>
  </h1>

</a>

<center>
<a href="https://github.com/bettercap/bettercap/releases/latest">
  <img alt="Release" src="https://img.shields.io/github/release/bettercap/bettercap.svg?style=flat-square">
</a>
</center>

    </div>
    
        <div class="searchbox">
    <label for="search-by"><i class="fas fa-search"></i></label>
    <input data-search-input id="search-by" type="search" placeholder="Search...">
    <span data-search-clear=""><i class="fas fa-times"></i></span>
</div>

<script type="text/javascript" src="/js/lunr.min.js?1559576463"></script>
<script type="text/javascript" src="/js/auto-complete.js?1559576463"></script>
<script type="text/javascript">
    
        var baseurl = "https:\/\/bettercap.org\/";
    
</script>
<script type="text/javascript" src="/js/search.js?1559576463"></script>

    
  </div>

    <div class="highlightable">
    <ul class="topics">

        
          
          


 
  
    
    <li data-nav-id="/intro/" title="Introduction" class="dd-item 
        
        
        
        ">
      <a href="/intro/">
          Introduction
          
      </a>
      
              
    </li>
  
 

          
          


 
  
    
    <li data-nav-id="/contributing/" title="Contributing" class="dd-item 
        
        
        
        ">
      <a href="/contributing/">
          Contributing
          
      </a>
      
              
    </li>
  
 

          
          


 
  
    
    <li data-nav-id="/installation/" title="Installation" class="dd-item 
        
        
        
        ">
      <a href="/installation/">
          Installation
          
      </a>
      
              
    </li>
  
 

          
          


 
  
    
    <li data-nav-id="/usage/" title="Usage" class="dd-item 
        parent
        active
        
        ">
      <a href="/usage/">
          Usage
          
      </a>
      
              
    </li>
  
 

          
          


 
  
    
    <li data-nav-id="/modules/" title="Modules" class="dd-item 
        
        
        
        ">
      <a href="/modules/">
          Modules
          
      </a>
      
      
        <ul>
          
          
            
          
          
          
        
          
            
            


 
  
    
    <li data-nav-id="/modules/core/" title="Core" class="dd-item 
        
        
        
        ">
      <a href="/modules/core/">
          Core
          
      </a>
      
      
        <ul>
          
          
            
          
          
          
        
          
            
            


 
  
    
    <li data-nav-id="/modules/core/events.stream/" title="events.stream" class="dd-item 
        
        
        
        ">
      <a href="/modules/core/events.stream/">
          events.stream
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/core/ticker/" title="ticker" class="dd-item 
        
        
        
        ">
      <a href="/modules/core/ticker/">
          ticker
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/core/caplets/" title="caplets" class="dd-item 
        
        
        
        ">
      <a href="/modules/core/caplets/">
          caplets
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/core/update/" title="update" class="dd-item 
        
        
        
        ">
      <a href="/modules/core/update/">
          update
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/core/api.rest/" title="api.rest" class="dd-item 
        
        
        
        ">
      <a href="/modules/core/api.rest/">
          api.rest
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/core/ui/" title="ui" class="dd-item 
        
        
        
        ">
      <a href="/modules/core/ui/">
          ui
          
      </a>
      
              
    </li>
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ble/" title="Bluetooth LE" class="dd-item 
        
        
        
        ">
      <a href="/modules/ble/">
          Bluetooth LE
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/wifi/" title="WiFi" class="dd-item 
        
        
        
        ">
      <a href="/modules/wifi/">
          WiFi
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/hid/" title="HID on 2.4Ghz" class="dd-item 
        
        
        
        ">
      <a href="/modules/hid/">
          HID on 2.4Ghz
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/" title="Ethernet" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/">
          Ethernet
          
      </a>
      
      
        <ul>
          
          
            
          
          
          
        
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/net.recon/" title="net.recon" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/net.recon/">
          net.recon
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/net.probe/" title="net.probe" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/net.probe/">
          net.probe
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/net.sniff/" title="net.sniff - net.fuzz" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/net.sniff/">
          net.sniff - net.fuzz
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/syn.scan/" title="syn.scan" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/syn.scan/">
          syn.scan
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/wol/" title="wake on lan" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/wol/">
          wake on lan
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/spoofers/" title="Spoofers" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/spoofers/">
          Spoofers
          
      </a>
      
      
        <ul>
          
          
            
          
          
          
        
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/spoofers/arp.spoof/" title="arp.spoof" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/spoofers/arp.spoof/">
          arp.spoof
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/spoofers/dns.spoof/" title="dns.spoof" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/spoofers/dns.spoof/">
          dns.spoof
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/spoofers/dhcp6.spoof/" title="dhcp6.spoof" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/spoofers/dhcp6.spoof/">
          dhcp6.spoof
          
      </a>
      
              
    </li>
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/proxies/" title="Proxies" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/proxies/">
          Proxies
          
      </a>
      
      
        <ul>
          
          
            
          
          
          
        
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/proxies/any.proxy/" title="any.proxy" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/proxies/any.proxy/">
          any.proxy
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/proxies/packet.proxy/" title="packet.proxy" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/proxies/packet.proxy/">
          packet.proxy
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/proxies/tcp.proxy/" title="tcp.proxy" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/proxies/tcp.proxy/">
          tcp.proxy
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/proxies/http.proxy/" title="http.proxy" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/proxies/http.proxy/">
          http.proxy
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/proxies/https.proxy/" title="https.proxy" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/proxies/https.proxy/">
          https.proxy
          
      </a>
      
              
    </li>
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/servers/" title="Servers" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/servers/">
          Servers
          
      </a>
      
      
        <ul>
          
          
            
          
          
          
        
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/servers/http.server/" title="http.server" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/servers/http.server/">
          http.server
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/servers/https.server/" title="https.server" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/servers/https.server/">
          https.server
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/servers/mdns.server/" title="mdns.server" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/servers/mdns.server/">
          mdns.server
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/ethernet/servers/mysql.server/" title="mysql.server (rogue)" class="dd-item 
        
        
        
        ">
      <a href="/modules/ethernet/servers/mysql.server/">
          mysql.server (rogue)
          
      </a>
      
              
    </li>
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/utils/" title="Utils" class="dd-item 
        
        
        
        ">
      <a href="/modules/utils/">
          Utils
          
      </a>
      
      
        <ul>
          
          
            
          
          
          
        
          
            
            


 
  
    
    <li data-nav-id="/modules/utils/mac.changer/" title="mac.changer" class="dd-item 
        
        
        
        ">
      <a href="/modules/utils/mac.changer/">
          mac.changer
          
      </a>
      
              
    </li>
  
 

            
          
            
            


 
  
    
    <li data-nav-id="/modules/utils/gps/" title="gps" class="dd-item 
        
        
        
        ">
      <a href="/modules/utils/gps/">
          gps
          
      </a>
      
              
    </li>
  
 

            
          
        
        </ul>
              
    </li>
  
 

            
          
        
        </ul>
              
    </li>
  
 

          
         
    </ul>

    
    
      <section id="shortcuts">
        <h3></h3>
        <ul>
          
              <li> 
                  <a class="padding" href="https://github.com/bettercap/bettercap"><i class='fab fa-github'></i> Github</a>
              </li>
          
              <li> 
                  <a class="padding" href="https://www.evilsocket.net/tags/bettercap/"><i class='fas fa-bullhorn'></i> Blog</a>
              </li>
          
              <li> 
                  <a class="padding" href="https://github.com/bettercap/bettercap/blob/master/LICENSE.md"><br/><img alt="Software License" src="https://img.shields.io/badge/license-GPL3-brightgreen.svg?style=flat-square"></a>
              </li>
          
              <li> 
                  <a class="padding" href="https://travis-ci.org/bettercap/bettercap"><img alt="Travis" src="https://img.shields.io/travis/bettercap/bettercap/master.svg?style=flat-square"></a>
              </li>
          
              <li> 
                  <a class="padding" href="https://goreportcard.com/report/github.com/bettercap/bettercap"><img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/bettercap/bettercap?style=flat-square&fuckgithubcache=1"></a>
              </li>
          
              <li> 
                  <a class="padding" href="http://godoc.org/github.com/bettercap/bettercap"><img alt="Go Doc" src="https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square"></a>
              </li>
          
              <li> 
                  <a class="padding" href="https://bettercap.org/legacy/"><br><i class='fas fa-bookmark'></i> Legacy v1.x Doc</a>
              </li>
          
        </ul>
      </section>
    

    
    <section id="footer">
      
    </section>
  </div>
</nav>





        <section id="body">
        <div id="overlay"></div>
        <div class="padding highlightable">
              
              <div>
                <div id="top-bar">
                
                  
                  
                  
                  <div id="top-github-link">
                    <a class="github-link" title='Edit this page' href="https://github.com/bettercap/website/edit/master/content/usage/_index.md" target="blank">
                      <i class="fas fa-code-branch"></i>
                      <span id="top-github-link-text">Edit this page</span>
                    </a>
                  </div>
                  
                
                
                <div id="breadcrumbs" itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb">
                    <span id="sidebar-toggle-span">
                        <a href="#" id="sidebar-toggle" data-sidebar-toggle="">
                          <i class="fas fa-bars"></i>
                        </a>
                    </span>
                  
                  <span id="toc-menu"><i class="fas fa-list-alt"></i></span>
                  
                  <span class="links">
                 
                 
                    
          
          
            
            
          
          
            <a href='/'></a> > Usage
          
         
          
        
                 
                  </span>
                </div>
                
                    <div class="progress">
    <div class="wrapper">
<nav id="TableOfContents">
<ul>
<li>
<ul>
<li>
<ul>
<li><a href="#web-ui">Web UI</a>
<ul>
<li><a href="#local-ui">Local UI</a></li>
<li><a href="#remote-ui">Remote UI</a></li>
</ul></li>
<li><a href="#interactive-session">Interactive Session</a></li>
<li><a href="#caplets">Caplets</a></li>
<li><a href="#command-line-arguments">Command Line Arguments</a>
<ul>
<li><a href="#autostart-modules"><code>-autostart MODULES</code></a></li>
<li><a href="#caplet-filename"><code>-caplet FILENAME</code></a></li>
<li><a href="#eval-commands"><code>-eval COMMANDS</code></a></li>
<li><a href="#iface-interface"><code>-iface INTERFACE</code></a></li>
<li><a href="#gateway-override-address"><code>-gateway-override ADDRESS</code></a></li>
<li><a href="#no-history"><code>-no-history</code></a></li>
<li><a href="#no-colors"><code>-no-colors</code></a></li>
<li><a href="#env-file-filename"><code>-env-file FILENAME</code></a></li>
<li><a href="#silent"><code>-silent</code></a></li>
<li><a href="#cpu-profile-filename"><code>-cpu-profile FILENAME</code></a></li>
<li><a href="#mem-profile-filename"><code>-mem-profile FILENAME</code></a></li>
<li><a href="#debug"><code>-debug</code></a></li>
<li><a href="#version"><code>-version</code></a></li>
</ul></li>
<li><a href="#core-commands">Core Commands</a>
<ul>
<li><a href="#help"><code>help</code></a></li>
<li><a href="#help-module-name"><code>help MODULE_NAME</code></a></li>
<li><a href="#active"><code>active</code></a></li>
<li><a href="#quit-or-q"><code>quit</code> or <code>q</code></a></li>
<li><a href="#sleep-seconds"><code>sleep SECONDS</code></a></li>
<li><a href="#get-parameter"><code>get PARAMETER</code></a></li>
<li><a href="#set-parameter-value"><code>set PARAMETER VALUE</code></a></li>
<li><a href="#read-parameter-prompt"><code>read PARAMETER PROMPT</code></a></li>
<li><a href="#clear"><code>clear</code></a></li>
<li><a href="#include-caplet"><code>include CAPLET</code></a></li>
<li><a href="#command"><code>!COMMAND</code></a></li>
<li><a href="#alias-mac-name"><code>alias MAC NAME</code></a></li>
</ul></li>
<li><a href="#customizing-the-prompt">Customizing the Prompt</a></li>
<li><a href="#examples">Examples</a></li>
</ul></li>
</ul></li>
</ul>
</nav>
    </div>
</div>

                
              </div>
            </div>
            

        
        <div id="body-inner">
          
            <h1>Usage</h1>
          

        




<h3 id="web-ui">Web UI</h3>

<p><img src="https://raw.githubusercontent.com/bettercap/media/master/ui-events.png" alt="UI" /></p>

<p>The easiest way to start playing with bettercap is using its official <a href="https://github.com/bettercap/ui">web user interface</a>, in order to install it make sure you have the <a href="https://github.com/bettercap/bettercap/releases">latest version of bettercap</a>, then:</p>

<pre><code class="language-sh">sudo bettercap -eval &quot;caplets.update; ui.update; q&quot;
</code></pre>

<div class="notices warning" ><p>Only run <code>caplets.update</code> the first time as every time the entire system caplets folder is replaced with the downloaded contents from github, overwriting your changes, such as the credentials, with default values. You can either backup your changes and restore them later in the system folder, or simply copy the changed caplet files in bettercap&rsquo;s working directory, in which case they&rsquo;ll be loaded before the ones installed system wide.</p>
</div>


<p>This will download and update your caplets and web ui from the latest github releases.</p>

<h4 id="local-ui">Local UI</h4>

<p>If you want both bettercap and the web ui running on your computer, you&rsquo;ll want to use the <code>http-ui</code> caplet which will start the <code>api.rest</code> and <code>http.server</code> modules on <code>127.0.0.1</code>.</p>

<p>Edit the default credentials in <code>/usr/local/share/bettercap/caplets/http-ui.cap</code> and then start the ui with:</p>

<pre><code class="language-sh">sudo bettercap -caplet http-ui
</code></pre>

<p>Open your browser to <code>http://127.0.0.1/</code> and login using the credentials you configured in the previous step.</p>

<h4 id="remote-ui">Remote UI</h4>

<p>If instead you&rsquo;re running bettercap on another host, say on a RaspberryPI or another machine with a different IP address, you want to use the <code>https-ui</code> caplet in order for the connection to the UI and the api to be protected by TLS. The caplet will bind the modules on <code>0.0.0.0</code> and generate a self signed certificate you can then allow in your browser.</p>

<p>Edit the default credentials in <code>/usr/local/share/bettercap/caplets/https-ui.cap</code> and then start the ui with:</p>

<pre><code class="language-sh">sudo bettercap -caplet https-ui
</code></pre>

<p>Open your browser to <code>https://&lt;ip of the machine&gt;/</code> and login using the credentials you configured in the previous step.</p>

<h3 id="interactive-session">Interactive Session</h3>

<p>Once started the tool with <code>sudo bettercap</code> (<a href="#command-line-arguments">click here</a> for the list of command line arguments), you&rsquo;ll be presented with an interactive session <em>a la Metasploit</em> where you&rsquo;ll be able to run commands, enable or disable modules, get or set parameters and so on.</p>

<div class="notices tip" ><p>Each command can either be executed singularly, or concatenated by the <code>;</code> operator, for instance, instead of typing:
<br/>
<code>clear</code><br/>
<code>net.show</code>
<br/>
You can simply type:
<br/>
<code>clear; net.show</code></p>
</div>


<p>Functionalities are organized in <strong><a href="#core-commands">core commands</a></strong> (basic commands you&rsquo;ll need to perform operations such as setting a session parameter, getting its value, clearing the screen, etc) and <strong><a href="/modules/">session modules</a></strong> (each will provide a set of feature specific sub commands and use some session parameters for its configuration).</p>

<h3 id="caplets">Caplets</h3>

<p>Other than executing commands manually one by one, it is possible to <em>script</em> your interactive session using <strong>caplets</strong>. Caplets (script files with a <code>.cap</code> extension) are a powerful way to automate your workflow: think about them as the Metasploit&rsquo;s <code>.rc</code> files, where each line of the file is a command that&rsquo;ll be executed at runtime.</p>

<p>For instance, a simple caplet that sets the <code>ticker.commands</code> parameter and enables the <a href="/modules/ethernet/net.probe/">net.probe</a> and <a href="/modules/core/ticker/">ticker</a> modules would be:</p>

<pre><code>set ticker.commands 'clear; net.show; events.show 10'
net.probe on
ticker on
</code></pre>

<p>Once saved as an <code>example.cap</code> file, you&rsquo;ll be able to load and execute it via:</p>

<pre><code>sudo bettercap -caplet /path/to/example.cap
</code></pre>

<p>It is also possible to load a caplet by name, without its path and extension:</p>

<pre><code>sudo bettercap -caplet example
</code></pre>

<p>In this case the search order will be:</p>

<ol>
<li><code>./example.cap</code></li>
<li><code>./caplets/example.cap</code></li>
<li>Any folder in the environment variable <code>$CAPSPATH</code> (values are separated by <code>:</code>, like for <code>$PATH</code>).</li>
<li><code>/usr/local/share/bettercap/caplets/example.cap</code> (the default path where caplets are installed).</li>
</ol>

<p>You can install (or update) the predefined caplets (hosted <a href="https://github.com/bettercap/caplets">in this repository</a>) by using the <a href="/modules/core/caplets/">caplet module</a>, either from the command line:</p>

<pre><code>sudo bettercap -eval &quot;caplets.update; q&quot;
</code></pre>

<p>Or simply from the interactive session:</p>

<pre><code>&gt; caplets.update
</code></pre>

<p>You can then check what&rsquo;s been installed in <code>/usr/local/share/bettercap/caplets/</code> with the command:</p>

<pre><code>&gt; caplets.show
</code></pre>

<h3 id="command-line-arguments">Command Line Arguments</h3>

<p>The basic command line arguments ( <code>bettercap -h</code> ) are:</p>

<h4 id="autostart-modules"><code>-autostart MODULES</code></h4>

<p>A comma separated list of modules that are automatically started (default to <code>events.stream</code>).</p>

<h4 id="caplet-filename"><code>-caplet FILENAME</code></h4>

<p>Read commands from this file and execute them in the interactive session.</p>

<h4 id="eval-commands"><code>-eval COMMANDS</code></h4>

<p>Run one or more commands separated by <code>;</code> in the interactive session, used to set variables via command line.</p>

<h4 id="iface-interface"><code>-iface INTERFACE</code></h4>

<p>Network interface to bind to, if empty the default interface will be auto selected (accepts interface name, ip or mac address)</p>

<h4 id="gateway-override-address"><code>-gateway-override ADDRESS</code></h4>

<p>Use the provided IP address instead of the default gateway. If not specified or invalid, the default gateway will be auto detected and used.</p>

<h4 id="no-history"><code>-no-history</code></h4>

<p>Disable the interactive session history file <code>~/.bettercap.history</code>.</p>

<h4 id="no-colors"><code>-no-colors</code></h4>

<p>Disable terminal colors and effects.</p>

<h4 id="env-file-filename"><code>-env-file FILENAME</code></h4>

<p>Preload the parameters values from this file if found, set to empty to disable environment persistance (default <code>~/bettercap.env</code>).</p>

<h4 id="silent"><code>-silent</code></h4>

<p>Suppress all logs which are not errors.</p>

<h4 id="cpu-profile-filename"><code>-cpu-profile FILENAME</code></h4>

<p>Write a CPU profile file when exiting (used for debugging and benchmarking).</p>

<h4 id="mem-profile-filename"><code>-mem-profile FILENAME</code></h4>

<p>Write memory profile file when exiting (used for debugging and benchmarking).</p>

<h4 id="debug"><code>-debug</code></h4>

<p>Enable debug messages (<strong>must be used <a href="/contributing/#reporting-bugs">to report bugs</a></strong>.</p>

<h4 id="version"><code>-version</code></h4>

<p>Print version and build information, then exit (<strong>must be used <a href="/contributing/#reporting-bugs">to report bugs</a></strong>.</p>

<h3 id="core-commands">Core Commands</h3>

<h4 id="help"><code>help</code></h4>

<p>Will list all available commands and print the name of each module and its status (<em>running</em> or <em>not running</em>).</p>

<h4 id="help-module-name"><code>help MODULE_NAME</code></h4>

<p>Will print the module specific help menu, with its sub commands and parameters.</p>

<h4 id="active"><code>active</code></h4>

<p>Show which modules are running and their parameters.</p>

<h4 id="quit-or-q"><code>quit</code> or <code>q</code></h4>

<p>Close the session and exit.</p>

<h4 id="sleep-seconds"><code>sleep SECONDS</code></h4>

<p>Sleep for the given amount of seconds.</p>

<h4 id="get-parameter"><code>get PARAMETER</code></h4>

<p>Get the value of the specified parameter, use <code>*</code> for all.</p>

<h4 id="set-parameter-value"><code>set PARAMETER VALUE</code></h4>

<p>Set the value of <code>PARAMETER</code> to <code>VALUE</code>, use <code>&quot;&quot;</code> or <code>''</code> to clear its contents.</p>

<h4 id="read-parameter-prompt"><code>read PARAMETER PROMPT</code></h4>

<p>Show a <code>PROMPT</code> to ask the user for input that will be saved inside <code>PARAMETER</code>.</p>

<h4 id="clear"><code>clear</code></h4>

<p>Clear the screen.</p>

<h4 id="include-caplet"><code>include CAPLET</code></h4>

<p>Load and run this caplet in the current session, the same behaviour can be achieved by just specifying the caplet name as a command.</p>

<h4 id="command"><code>!COMMAND</code></h4>

<p>Execute a shell command and print its output into the session.</p>

<h4 id="alias-mac-name"><code>alias MAC NAME</code></h4>

<p>Assign an alias to a given endpoint given its MAC address (will be persistent on <code>~/bettercap.aliases</code>).</p>

<div class="notices tip" ><p>Being persisted on disk, aliases are shared across each module and bettercap session. This means that if you set an alias for a computer while on the same network, the same alias will be shown and used, for instance, by the WiFi modules when resolving wireless stations BSSID (you&rsquo;ll see who&rsquo;s connecting to what).</p>
</div>


<h3 id="customizing-the-prompt">Customizing the Prompt</h3>

<p>The interactive session prompt can be modified by setting the <code>$</code> variable, for instance this:</p>

<pre><code>set $ something
</code></pre>

<p>Will set the prompt to the string <code>something</code>. You can also access parameters and use colors/effects by using the proper syntax and operators as you can see from the <code>$</code> parameter default value:</p>

<pre><code>&gt; get $


{by}{fw}{cidr} {fb}&gt; {env.iface.ipv4} {reset} {bold}» {reset}
</code></pre>

<p>The available effects are:</p>

<table>
<thead>
<tr>
<th>Operator</th>
<th>Description</th>
</tr>
</thead>

<tbody>
<tr>
<td><code>{bold}</code></td>
<td>Set text to bold.</td>
</tr>

<tr>
<td><code>{dim}</code></td>
<td>Set dim effect on text.</td>
</tr>

<tr>
<td><code>{r}</code></td>
<td>Set text foreground color to red.</td>
</tr>

<tr>
<td><code>{g}</code></td>
<td>Set text foreground color to red.</td>
</tr>

<tr>
<td><code>{b}</code></td>
<td>Set text foreground color to red.</td>
</tr>

<tr>
<td><code>{y}</code></td>
<td>Set text foreground color to red.</td>
</tr>

<tr>
<td><code>{fb}</code></td>
<td>Set text foreground color to black.</td>
</tr>

<tr>
<td><code>{fw}</code></td>
<td>Set text foreground color to white.</td>
</tr>

<tr>
<td><code>{bdg}</code></td>
<td>Set text background color to dark gray.</td>
</tr>

<tr>
<td><code>{br}</code></td>
<td>Set text background color to red.</td>
</tr>

<tr>
<td><code>{bg}</code></td>
<td>Set text background color to green.</td>
</tr>

<tr>
<td><code>{by}</code></td>
<td>Set text background color to yellow.</td>
</tr>

<tr>
<td><code>{blb}</code></td>
<td>Set text background color to light blue.</td>
</tr>

<tr>
<td><code>{reset}</code></td>
<td>Reset text effects (added by default at the end of the prompt if not specified).</td>
</tr>
</tbody>
</table>

<p>There are also other operators you can use in order to access specific information about the session.</p>

<table>
<thead>
<tr>
<th>Operator</th>
<th>Description</th>
</tr>
</thead>

<tbody>
<tr>
<td><code>{cidr}</code></td>
<td>Selected interface subnet CIDR.</td>
</tr>

<tr>
<td><code>{net.sent}</code></td>
<td>Number of bytes being sent by the tool on the network.</td>
</tr>

<tr>
<td><code>{net.sent.human}</code></td>
<td>Number of bytes being sent by the tool on the network (human readable form).</td>
</tr>

<tr>
<td><code>{net.errors}</code></td>
<td>Number of errors while sending packets.</td>
</tr>

<tr>
<td><code>{net.received}</code></td>
<td>Number of bytes being sniffed from the tool on the network.</td>
</tr>

<tr>
<td><code>{net.received.human}</code></td>
<td>Number of bytes being sniffed from the tool from the network (human readable form).</td>
</tr>

<tr>
<td><code>{net.packets}</code></td>
<td>Number of packets being sniffed by the tool from the network.</td>
</tr>
</tbody>
</table>

<p>And finally, you can access and use any variable that has been declared in the interactive session using the <code>{env.NAME-OF-THE-VAR}</code> operator, for instance, the default prompt is using <code>{env.iface.ipv4}</code> that is replaced by the <code>iface.ipv4</code> session variable contents ( you can check it using the <code>get iface.ipv4</code> command ).</p>

<h3 id="examples">Examples</h3>

<p>Set the <code>arp.spoof.targets</code> parameter and enable the <code>arp.spoof</code> module:</p>

<pre><code class="language-sh">sudo bettercap -eval &quot;set arp.spoof.targets 192.168.1.20; arp.spoof on&quot;
</code></pre>

<p>To quickly get the help menu of a module and quit bettercap (basically like a <em>man</em> command), you can use the <code>-eval</code> argument, for example:</p>

<pre><code class="language-sh">sudo bettercap -eval &quot;help net.recon; q&quot;
</code></pre>

<p>Ask the user to fill the <code>arp.spoof.targets</code> parameter:</p>

<pre><code>&gt; read arp.spoof.targets &quot;Select the target to spoof: &quot;
</code></pre>

<p>Set the alias <em>&ldquo;MY IPAD&rdquo;</em> to the device with MAC address <code>DE:AD:DE:AD:BE:EF</code>:</p>

<pre><code>&gt; alias DE:AD:DE:AD:BE:EF MY IPAD
</code></pre>


<footer class=" footline" >
	
</footer>

        
        </div> 
        

      </div>

    <div id="navigation">
        
        
        
        
            
            
                
                    
                    
                
                

                    
                    
                        
                    
                    

                    
                        
            
            
                
                    
                        
                        
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                        
                        
                    
                
                

                    
                    
                        
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                        
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                        
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                        
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                        
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                        
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                        
                    
                    

                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
                        
            
            
                
                    
                
                

                    
                    
                    

                    
            
        
                    
            
        
                    
            
        
                    
            
        
        
        


	 
	 
		
			<a class="nav nav-prev" href="/installation/" title="Installation"> <i class="fa fa-chevron-left"></i></a>
		
		
			<a class="nav nav-next" href="/modules/" title="Modules" style="margin-right: 0px;"><i class="fa fa-chevron-right"></i></a>
		
	
    </div>

    </section>
    
    <div style="left: -1000px; overflow: scroll; position: absolute; top: -1000px; border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;">
      <div style="border: none; box-sizing: content-box; height: 200px; margin: 0px; padding: 0px; width: 200px;"></div>
    </div>
    <script src="/js/clipboard.min.js?1559576463"></script>
    <script src="/js/perfect-scrollbar.min.js?1559576463"></script>
    <script src="/js/perfect-scrollbar.jquery.min.js?1559576463"></script>
    <script src="/js/jquery.sticky.js?1559576463"></script>
    <script src="/js/featherlight.min.js?1559576463"></script>
    <script src="/js/html5shiv-printshiv.min.js?1559576463"></script>
    <script src="/js/highlight.pack.js?1559576463"></script>
    <script>hljs.initHighlightingOnLoad();</script>
    <script src="/js/modernizr.custom.71422.js?1559576463"></script>
    <script src="/js/learn.js?1559576463"></script>
    <script src="/js/hugo-learn.js?1559576463"></script>

    <link href="/mermaid/mermaid.css?1559576463" type="text/css" rel="stylesheet" />
    <script src="/mermaid/mermaid.js?1559576463"></script>
    <script>
        mermaid.initialize({ startOnLoad: true });
    </script>
    <script async defer src="https://buttons.github.io/buttons.js"></script>

<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-65617603-1");
pageTracker._trackPageview();
} catch(err) {}</script>

  </body>
</html>
